import pandas as pandas
import numpy as numpy
train = pandas.read_csv("day.csv")
#print(train.head())
#print(train.describe())
categorical_features = ['season','mnth','weathersit','weekday']
'''
for col in categorical_features:
    print '\n%sdifferent properties show count'%col
    print train[col].value_counts()
    train[col] = train[col].astype('object')
'''
categorical_features = ['season','mnth','weathersit','weekday']
x_train_cat = train[categorical_features]
x_train_cat = pandas.get_dummies(x_train_cat)
x_train_cat.head()
from sklearn.preprocessing import MinMaxScaler
mn_x = MinMaxScaler()
numerical_features = ['temp','atemp','hum','windspeed']
temp = mn_x.fit_transform(train[numerical_features])

x_train_num = pandas.DataFrame(data=temp, columns=numerical_features, index =train.index)
x_train_num.head()
x_train = pandas.concat([x_train_cat, x_train_num, train['holiday'],  train['workingday']], axis = 1, ignore_index=False)
#print(x_train.head())

FE_train = pandas.concat([train['instant'], x_train,  train['yr'],train['cnt']], axis = 1)
FE_train.to_csv('FE_day.csv', index=False)
#print(FE_train.head())
